import React, {Component} from 'react';
import { Table} from 'antd';

export default class StandardTable extends Component<any, any> {

  rowSelection = {
    onChange: this.props.selectionsChange
  };
  render() {
    const { tableData, rowKey, loading, pageTotal,tableChange,columns } = this.props;
    const pagination = {
      showQuickJumper: true,
      showSizeChanger: true,
      size: 'small',
      total: pageTotal,
      showTotal: (total: any) => `共${total}条`,
    };

    return (
      <Table
        rowSelection={this.rowSelection}
        dataSource={tableData}
        rowKey={rowKey || 'id' }
        loading={loading}
        onChange={tableChange}
        pagination={pagination}
        columns={columns} />
    );
  }
}
